package com.example.sourcesprng.define_factorybean.myobject;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

@Component
public class MyFactoryBean implements FactoryBean<MyObject> {
    @Override
    public MyObject getObject() throws Exception {
        MyObject myObject = new MyObject();
        myObject.setName("张三");
        myObject.setAge(18);
        myObject.setBirthday("2000-01-01");
        return myObject;
    }


    @Override
    public Class<MyObject> getObjectType() {
        return MyObject.class;
    }

    @Override
    public boolean isSingleton() {
        return FactoryBean.super.isSingleton();
    }
}
